<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
   'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
  <html xmlns='http://www.w3.org/1999/xhtml'>
    <head>
      <meta http-equiv='content-type' content='text/html; charset=utf-8' />
      <meta name='generator' content='CoverStory' />
      <link rel=StyleSheet href='coverstory.css' type='text/css'>
      <script src='coverstory.js' language='javascript' type='text/javascript'></script>
      <title>TableViewController.m</title>
    </head>
    <body id='coverstory' onload='coverstory_load()' onunload='coverstory_unload()'>
      <div id='maincontainer'>
        <h1 id='sourcename'>TableViewController.m</h1>
        <h2 id='sourcepath'>/Users/ankitthakur/Documents/Sample/XCode Tools/ATNetworks/Classes/TableViewController.m</h2>
        <div id='sourcedate'>15/06/10 6:47 PM</div>
        <div id='filelistcontainer'>
          <div id='filesummary'>35.8% of 1100 lines</div>
          <table id='filetable'>
            <tr id='filelistheader'>
              <th id='filelistheadersource'>Source</th>
              <th id='filelistheaderpercent'>%</th>
            </tr>
            <tr class='fileline'>
<td class='filename'><a href='ATImageDownloader.m.html'>ATImageDownloader.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATImageOperation.m.html'>ATImageOperation.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='GridView.m.html'>GridView.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='IconView.m.html'>IconView.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='NSObject+SBJSON.m.html'>NSObject+SBJSON.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='NSString+SBJSON.m.html'>NSString+SBJSON.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='Reachability.m.html'>Reachability.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='TableViewCell.m.html'>TableViewCell.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>0.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='SBJsonWriter.m.html'>SBJsonWriter.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>2.63</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='Music.m.html'>Music.m</a></td>
<td class='filepercent'><span class='filelessthan25percent'>7.69</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='SBJSON.m.html'>SBJSON.m</a></td>
<td class='filepercent'><span class='filelessthan35percent'>30.16</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATJSONDispatcher.m.html'>ATJSONDispatcher.m</a></td>
<td class='filepercent'><span class='filelessthan45percent'>35.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='SBJsonParser.m.html'>SBJsonParser.m</a></td>
<td class='filepercent'><span class='filelessthan55percent'>46.36</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATNetworksAppDelegate.m.html'>ATNetworksAppDelegate.m</a></td>
<td class='filepercent'><span class='filelessthan55percent'>50.00</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='SBJsonBase.m.html'>SBJsonBase.m</a></td>
<td class='filepercent'><span class='filelessthan65percent'>60.87</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATNetwork.m.html'>ATNetwork.m</a></td>
<td class='filepercent'><span class='filelessthan75percent'>69.89</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='main.m.html'>main.m</a></td>
<td class='filepercent'><span class='filelessthan75percent'>71.43</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATIconDownloader.m.html'>ATIconDownloader.m</a></td>
<td class='filepercent'><span class='filelessthan75percent'>72.34</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='TableViewController.m.html'>TableViewController.m</a></td>
<td class='filepercent'><span class='filegoodcoveragepercent'>79.71</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATNetworksViewController.m.html'>ATNetworksViewController.m</a></td>
<td class='filepercent'><span class='filegoodcoveragepercent'>89.36</span></td>
</tr>
<tr class='fileline'>
<td class='filename'><a href='ATConnection.m.html'>ATConnection.m</a></td>
<td class='filepercent'><span class='filegoodcoveragepercent'>100.00</span></td>
</tr>

          </table>
        </div>
        <div id='sourcecontainer'>
          <div id='sourcesummary'>Executed 79.7% of 69 lines (55 executed, 69 executable, 275 total lines)</div>
          <table id='sourcetable'>
          <tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>//</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>//  TableViewController.m</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>//  ATNetworks</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>//</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>//  Created by Ranjit2 on 16/05/10.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>//  Copyright 2010 __MyCompanyName__. All rights reserved.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>//</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>#import &quot;TableViewController.h&quot;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>#import &quot;Music.h&quot;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>@implementation TableViewController</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>@synthesize results;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>- (id)initWithStyle:(UITableViewStyle)style {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    // Override initWithStyle: if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    if (self = [super initWithStyle:style]) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    return self;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>- (void)viewDidLoad {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    [super viewDidLoad];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    // self.navigationItem.rightBarButtonItem = self.editButtonItem;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>/*</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (void)viewWillAppear:(BOOL)animated {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    [super viewWillAppear:animated];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>*/</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>/*</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (void)viewDidAppear:(BOOL)animated {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    [super viewDidAppear:animated];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>*/</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>/*</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (void)viewWillDisappear:(BOOL)animated {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  [super viewWillDisappear:animated];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>*/</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>/*</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (void)viewDidDisappear:(BOOL)animated {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  [super viewDidDisappear:animated];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>*/</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>/*</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>// Override to allow orientations other than the default portrait orientation.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    // Return YES for supported orientations</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    return (interfaceOrientation == UIInterfaceOrientationPortrait);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>*/</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>- (void)didReceiveMemoryWarning {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  // Releases the view if it doesn&apos;t have a superview.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    [super didReceiveMemoryWarning];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  // Release any cached data, images, etc that aren&apos;t in use.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>- (void)viewDidUnload {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  // Release any retained subviews of the main view.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  // e.g. self.myOutlet = nil;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>#pragma mark Table view methods</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>44</td>
<td class='sourcelinehit'>- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>44</td>
<td class='sourcelinehit'>    return 1;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>// Customize the number of rows in the table view.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>22</td>
<td class='sourcelinehit'>- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>22</td>
<td class='sourcelinehit'>    return [self.results count];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>// Customize the appearance of table view cells.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>71</td>
<td class='sourcelinehit'>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>71</td>
<td class='sourcelinehit'>    NSString *CellIdentifier = [NSString stringWithFormat:@&quot;Cell %@&quot;,indexPath];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>71</td>
<td class='sourcelinehit'>    NSString *PlaceholderCellIdentifier = [NSString stringWithFormat:@&quot;PlaceholderCell %@&quot;,indexPath];    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    // add a placeholder cell while waiting on table data</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>71</td>
<td class='sourcelinehit'>    int nodeCount = [self.results count];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>71</td>
<td class='sourcelinehit'>  if (nodeCount == 0 &amp;&amp; indexPath.row == 0)</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:PlaceholderCellIdentifier];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        if (cell == nil)</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                                           reuseIdentifier:PlaceholderCellIdentifier] autorelease];   </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            cell.detailTextLabel.textAlignment = UITextAlignmentCenter;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>            cell.selectionStyle = UITableViewCellSelectionStyleNone;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        cell.detailTextLabel.text = @&quot;Loading…&quot;;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        return cell;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>71</td>
<td class='sourcelinehit'>  UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>71</td>
<td class='sourcelinehit'>    if (cell == nil)</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>71</td>
<td class='sourcelinehit'>        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                                       reuseIdentifier:CellIdentifier] autorelease];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>71</td>
<td class='sourcelinehit'>        cell.selectionStyle = UITableViewCellSelectionStyleNone;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    // Leave cells empty if there&apos;s no data yet</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>71</td>
<td class='sourcelinehit'>    if (nodeCount &gt; 0)</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        // Set up the cell...</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>71</td>
<td class='sourcelinehit'>        Music *music = [self.results objectAtIndex:indexPath.row];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>71</td>
<td class='sourcelinehit'>    cell.textLabel.text = music.name;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>71</td>
<td class='sourcelinehit'>        cell.detailTextLabel.text = music.artist;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    // Only load cached images; defer new downloads until scrolling ends</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>71</td>
<td class='sourcelinehit'>        if (!music.image)</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>50</td>
<td class='sourcelinehit'>            if (self.tableView.dragging == NO &amp;&amp; self.tableView.decelerating == NO)</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>10</td>
<td class='sourcelinehit'>                [self startIconDownload:music forIndexPath:indexPath];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            // if a download is deferred or in progress, return a placeholder image</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>                         </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        else</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>21</td>
<td class='sourcelinehit'>      cell.imageView.image = music.image;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    // Set up the cell...</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>71</td>
<td class='sourcelinehit'>    return cell;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>#pragma mark Table cell image support</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (void)startIconDownload:(Music *)music forIndexPath:(NSIndexPath *)indexPath</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>21</td>
<td class='sourcelinehit'>{</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>21</td>
<td class='sourcelinehit'>    ATIconDownloader *iconDownloader = [[[ATIconDownloader alloc] init] autorelease];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>21</td>
<td class='sourcelinehit'>  iconDownloader.imageUrl = music.imageUrl;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>21</td>
<td class='sourcelinehit'>  NSLog(@&quot;startIconDownload iconDownloader.imageUrl is %@&quot;,iconDownloader.imageUrl);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>21</td>
<td class='sourcelinehit'>  NSLog(@&quot;startIconDownload indexPath is %@&quot;,indexPath);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>21</td>
<td class='sourcelinehit'>  iconDownloader.id_ = indexPath;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>21</td>
<td class='sourcelinehit'>  [iconDownloader openConnection:music.imageUrl withCallBackTarget:indexPath withDelegate:self];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>21</td>
<td class='sourcelinehit'>-(void) imageDownloadFinish:(UIImage*)image_ withId:(NSIndexPath*)id_{</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>21</td>
<td class='sourcelinehit'>  NSLog(@&quot;imageDownloadFinish id_ is %@&quot;,id_);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>21</td>
<td class='sourcelinehit'>   Music *music = [self.results objectAtIndex:id_.row];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>21</td>
<td class='sourcelinehit'>  NSLog(@&quot;imageDownloadFinish music.imageUrl is %@&quot;,music.imageUrl);</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>21</td>
<td class='sourcelinehit'>  [music setImage:image_];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>21</td>
<td class='sourcelinehit'>  [self.results replaceObjectAtIndex:id_.row withObject:music];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>//  [[[self.tableView cellForRowAtIndexPath:id_] imageView] setImage:image_];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>21</td>
<td class='sourcelinehit'>  UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:id_];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  // Display the newly loaded image</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>21</td>
<td class='sourcelinehit'>  cell.imageView.image = image_;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>21</td>
<td class='sourcelinehit'>  [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:id_] withRowAnimation:UITableViewRowAnimationNone];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>// this method is used in case the user scrolled into a set of cells that don&apos;t have their app icons yet</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (void)loadImagesForOnscreenRows</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>{</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    if ([self.results count] &gt; 0)</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>        NSArray *visiblePaths = [self.tableView indexPathsForVisibleRows];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>12</td>
<td class='sourcelinehit'>        for (NSIndexPath *indexPath in visiblePaths)</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>11</td>
<td class='sourcelinehit'>            Music *music = [self.results objectAtIndex:indexPath.row];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>11</td>
<td class='sourcelinehit'>            if (!music.image) // avoid the app icon download if the app already has an icon</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>11</td>
<td class='sourcelinehit'>                [self startIconDownload:music forIndexPath:indexPath];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>            }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>// Load images for all onscreen rows when scrolling is finished</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>{</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    if (!decelerate)</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>        [self loadImagesForOnscreenRows];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>{</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>1</td>
<td class='sourcelinehit'>    [self loadImagesForOnscreenRows];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    // Navigation logic may go here. Create and push another view controller.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  // AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@&quot;AnotherView&quot; bundle:nil];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  // [self.navigationController pushViewController:anotherViewController];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>  // [anotherViewController release];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>/*</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>// Override to support conditional editing of the table view.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    // Return NO if you do not want the specified item to be editable.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    return YES;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>*/</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>/*</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>// Override to support editing the table view.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    if (editingStyle == UITableViewCellEditingStyleDelete) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        // Delete the row from the data source</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }   </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    else if (editingStyle == UITableViewCellEditingStyleInsert) {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    }   </td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>*/</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>/*</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>// Override to support rearranging the table view.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>*/</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>/*</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>// Override to support conditional rearranging of the table view.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    // Return NO if you do not want the item to be re-orderable.</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>    return YES;</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>*/</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>- (void)dealloc {</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>0</td>
<td class='sourcelinemissed'>    [super dealloc];</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'>}</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'>219</td>
<td class='sourcelinehit'>@end</td>
</tr>
<tr class='sourceline'>
<td class='sourcelinehitcount'></td>
<td class='sourcelineskipped'></td>
</tr>

          </table>
        </div>
      </div>
    </body>
  </html>